<script setup>
    import Child from './Child.vue'
    import MyComponent from './MyComponent.vue'
    const handleCustomEvent=(message) => {
        console.log(message);       //输出Hello from Child!
    };
</script>

<template>
    <div>
        <h1>父组件</h1>
        <p>这是父组件页面</p>
        
        <my-component prop-name="来自父组件的消息"></my-component>

        <!-- 绑定自定义事件，监听子组件customEvent事件，并触发handleCustomEvent事件 -->
        <child @custom-event="handleCustomEvent"></child>
    </div>
</template>